//
//  ALLViewController.m
//  MoBan
//
//  Created by apple on 16/7/6.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "ALLViewController.h"
#import "MoBanOneViewController.h"
#import "MoBanTwoViewController.h"
#import "MoBanThreeViewController.h"

@interface ALLViewController ()<UITableViewDataSource,UITableViewDelegate>
@property(nonatomic,strong)UITableView *tableview;
@property(nonatomic,strong)NSArray *array;
@property(nonatomic,strong)NSArray *VcArray;
@end

@implementation ALLViewController
-(NSArray *)VcArray
{
    if (!_VcArray) {
        _VcArray =@[@"MoBanOneViewController",@"MoBanTwoViewController",@"MoBanThreeViewController",@"ZBMoBanFourViewController",@"ZBMoBanFiveViewController",@"ZBMoBanSixViewController",@"ZBMoBanSevenViewController",@"ZBMoBanEightViewController",@"ZBMoBanNineViewController",@"ZBMoBanTenViewController",@"MoBanElevenViewController",@"MoBanTwalveViewController",@"MoBanThirteenViewController"];
    }
    return _VcArray;
}
-(NSArray *)array
{
    if (!_array) {
        _array = @[@"模板1",@"模板2",@"模板3",@"模板4",@"模板5",@"模板6",@"模板7",@"模板8",@"模板9",@"模板10",@"模板11",@"模板12",@"模板13"];
    }
    return _array;
}
-(UITableView *)tableview
{
    if (!_tableview) {
        _tableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, KscrW, KscrH-KBar1)];
        _tableview.dataSource = self;
        _tableview.delegate = self;
    }
    return _tableview;

}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.tableview];
    // Do any additional setup after loading the view.
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.array.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];

    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    }
    cell.textLabel.text = self.array[indexPath.row];
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    id  convc =  [[NSClassFromString(self.VcArray[indexPath.row]) alloc]init];
    
//    convc *vc = [[convc alloc]init];
    
    [self.navigationController pushViewController:convc animated:YES];
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
